export function timeStamp2Date(timeStamp: number): string {
  const now = new Date();
  const inputDate = new Date(timeStamp);
  
  // 判断是否是今天
  if (now.toDateString() === inputDate.toDateString()) {
    const diffMinutes = Math.floor((now.getTime() - timeStamp) / (1000 * 60));
    if (diffMinutes < 1) {
      return '刚刚';
    }
  }
  
  // 判断是否是昨天
  const yesterday = new Date(now);
  yesterday.setDate(now.getDate() - 1);
  if (yesterday.toDateString() === inputDate.toDateString()) {
    return '昨天';
  }
  
  // 其他日期返回年月日格式
  const Y = inputDate.getFullYear() + '-';
  const M = (inputDate.getMonth() + 1 < 10 ? '0' + (inputDate.getMonth() + 1) : inputDate.getMonth() + 1) + '-';
  const D = inputDate.getDate() < 10 ? '0' + inputDate.getDate() : inputDate.getDate();
  return Y + M + D;
}